﻿
@{
    ViewBag.Title = "按航空公司查找";
    Layout = "~/Views/Shared/_Layout_Content.cshtml";
}
@section styles
    {
    <environment names="Development">
        <link href="~/css/plugins/jqgrid/ui.jqgrid.css" rel="stylesheet" />
    </environment>
    <environment names="Staging,Production">
        <link rel="stylesheet" href="~/css/grid.min.css" asp-append-version="true" />
    </environment>
        <style>
            .header {
                height: 80px;
            }

            .formsearch {
                margin-top: 20px;
            }

            .header .box {
                width: 100%;
                height: 80px;
                background-color: #ccc;
                box-shadow: 0px 1px 10px #ccc;
            }
        </style>
}

<script type="text/javascript" src="~/js/echarts.js" charset="UTF-8"></script>

<script src="~/js/bmap.js" charset="UTF-8"></script>
<script src="~/js/jquery-3.2.1.min.js" charset="UTF-8"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/lib/AdminLTE-2.4.2/dist/js/adminlte.js"></script>
<link rel="stylesheet" href="~/lib/Font-Awesome-master/css/font-awesome.css">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css">
<link rel=" stylesheet" href="~/lib/AdminLTE-2.4.2/dist/css/AdminLTE.css">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="~/lib/AdminLTE-2.4.2/dist/css/skins/skin-blue.css">


<div class="header">
    <div class="box">
        <div class="col-xs-8 col-xs-offset-2">
            <form asp-action="_Ac" method="get" name="myform">
                <div class="formsearch input-group">
                    <input id="txtSearchKey" type="text" name="SearchStrings" class="input form-control" value="@ViewData["currentFilters"]" placeholder="搜索关键字" />
                    <span class="input-group-btn">
                        <button id="btnSearch" class="btn btn btn-primary"><i class="fa fa-search"></i>搜索</button>
                    </span>
                </div>
            </form>
        </div>
    </div>
</div>
<div class="container col-xs-12">
    <div class="box-body">
        <div class="box-header">
            <h3 class="box-title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">选择航空公司</font></font></h3>
            <h3 class="pages box-title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">第</font></font></h3>
            <h3 class="pagess box-title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">一共</font></font></h3>
        </div>
        <table class="bodytable table table-striped">
            <tr>
            </tr>
        </table>

    </div>


    <!--<div class="input-group">
        @* 详细筛选框 *@
        <form asp-action="_Ac" method="get" name="myform">
            <div class="form-actions no-color">
                <button type="submit" id="btn" name="page" value="上一页">上一页</button>
                <button type="submit" id="btns" name="pageadds" value="下一页">下一页</button>
                <p>
                    页面跳转: <input type="text" name="SearchString" value="@ViewData["currentFilter"]" />
                    <button id="btnss" name="pageadds">跳转</button>
                </p>
            </div>
        </form>
    </div>-->
    <div class="bottom_fenye">
        <div class="page">
            <form asp-action="_Ac" method="get" name="myform">
                <table>
                    <tr>
                        <td>
                            <div class="fenye_1 input-group">
                                <button id="btn" name="page" class="btn btn-primary btn-sm">上一页</button>
                            </div>
                        </td>
                        <td>
                            <div class="fenye_1 input-group ">
                                <input type="number" name="SearchString" value="@ViewData["currentFilter"]" class="form-control" placeholder="跳转页数" style="height:30px;width:100px" />
                                <span class="input-group-btn">
                                    <button id="btnss" name="pageadds" class="btn btn-default btn-sm">跳转</button>
                                </span>
                            </div>
                        </td>
                        <td>
                            <div class="fenye_1 input-group">
                                <button id="btns" name="pageadds" class="btn btn-primary btn-sm">下一页</button>
                            </div>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
    </div>
    @section scripts
        {
        <environment names="Development">
            <script src="~/js/plugins/jqgrid/jquery.jqGrid.js"></script>
            <script src="~/js/plugins/jqgrid/i18n/grid.locale-cn.js"></script>
            <script src="~/js/jqgrid-list.js"></script>
            <script src="~/js/json2.js"></script>
            <script src="~/js/base.js"></script>
        </environment>
        <environment names="Staging,Production">
            <script src="~/js/grid.min.js" asp-append-version="true"></script>
        </environment>
        <style>
            <style > .header {
                height: 80px;
            }

            .formsearch {
                margin-top: 20px;
            }

            .header .box {
                width: 100%;
                height: 80px;
                background-color: #ccc;
                box-shadow: 0px 1px 10px #ccc;
            }

            .box-body table td {
                border-left: 1px solid #ccc;
            }

            .page {
                width: 280px;
                height: 40px;
                margin: 0 auto;
            }
        </style>

        <script>

    var Data = [];
       $.ajax({
            url: '@Url.Action("GetListWithAc")',
            type: "get",
            dataType: "Json",
            success: function (resp, status)
            {


                for (i = 0; i < resp.rows.length; i++)
                {
                    var tr = "<tr><td><a href=/hbxx/_Acs/" + resp.rows[i].acs + ">" + resp.rows[i].acs
                        +"</td></tr>"
                    $('.bodytable').append(tr);
                    if (i == resp.rows.length - 1) {
                        $('.pages').append(resp.page + "页");
                        $('.pagess').append(resp.total + "页");
                    }
                };
                var url = '/Hbxx/_Ac/'+resp.rows[1].acs;

                //翻页上一页
                $(function () {
                    $('#btn').click(function () {
                        $.ajax({
                            'type': 'post', 'url': url,
                            //传递的数据也可以是序列化之后的json格式数据
                            //如，上面使用form表单提交数据就可以使用jquery中的serialize()方法将表单进行序列化之后在提交
                            //data:$('#form').serialize()
                            'data': {
                                page: [resp.page - 1],
                                acs: [resp.rows[1].acs],
                            },
                            error: function (message) {
                                alert('error!');
                            }
                        });
                    })
                })


                //翻页下一页
                $(function () {
                    $('#btns').click(function () {
                        $.ajax({
                            'type': 'post', 'url': url,
                            //传递的数据也可以是序列化之后的json格式数据
                            //如，上面使用form表单提交数据就可以使用jquery中的serialize()方法将表单进行序列化之后在提交
                            //data:$('#form').serialize()
                            'data': {
                                page: [resp.page + 1],
                                acs: [resp.rows[1].acs],
                            },
                            error: function (message) {
                                alert('error!');
                            }
                        });
                    })
                })

            },
           error: function ()
            {
                // view("异常！");
                alert("数据加载失败！");
            }
        });

        </script>
    }
